﻿using EFCore.Context;
using IResoitory;
using Microsoft.EntityFrameworkCore;
using Model;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace Resoitory
{
    //仓储层_班级表接口实现类
    public class ClassesRepository : BaseRepository<Classes>,IClassesRepository
    {
        private readonly EducationContext _context;

        public ClassesRepository(EducationContext context)
        {
            base.context = context;
            _context = context;
        }
        //班级表删除
        public async override Task<bool> onDelete(int id)
        {
            var result = await _context.Set<Classes>().FindAsync(id);
            result.IsDelete = true;
            return await _context.SaveChangesAsync() > 0;
        }
    }
}
